<?php
namespace Admin\Controller;
use   Think\Controller;
class OrderController extends Controller{
	public function add(){
		
	}
	public function lst(){
		 
		    $orderModel  = D('order');
    	    $orderData = $orderModel->field('a.*,b.goods_id,b.goods_number,b.price,c.goods_name')->alias('a')
    	                 ->join('left join s50_order_goods b on a.id = b.order_id left join s50_goods c on c.id = b.goods_id')
    	                 ->select();
	    //echo '<pre>';
	    //var_dump($orderData);die();
    	    $demo = $orderModel->search();
    	   // echo '<pre>';
    	    //var_dump($demo);die();
    	    $this->assign(array(
    	    		
    	    		'data'=>$demo['data'],
    	    		'page'=>$demo['page'],
    	    ));
    	    
	     $this->assign(array(
	     	'orderData'=>$orderData,
	     	'goodsname'=>$goodsname,
	     ));
		$this->display();
	}
	
	//删除订单
	public function delete(){
		$id = I('get.id');
		 $orderModel = D('order');
		 if($orderModel ->delete($id)){
		 	$this->success('删除成功');
		 }
	}
	
}